//
//  RecommendGridCollectionViewCell.swift
//  xmly
//
//  Created by 刘文超 on 2019/12/30.
//  Copyright © 2019 刘文超. All rights reserved.
//

import UIKit

class RecommendGridCollectionViewCell: UICollectionViewCell {
    
    private lazy var iconimageView: UIImageView = {
        let imageView = UIImageView()
        imageView.image = UIImage.init(named: "商城")
        return imageView
    }()
    private lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.textAlignment = .center
        label.text = "分类"
        label.font = UIFont.systemFont(ofSize: 13)
        return label
    }()
    
    private lazy var lineView: UIView = {
        let view = UIView()
        view.backgroundColor = lineGrayColor
        return view
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.addSubview(iconimageView)
        self.iconimageView.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.centerY.equalTo(self.snp.centerY).offset(-KBlackspace)
            make.height.width.equalTo(43.0)
        }
        self.addSubview(titleLabel)
        self.titleLabel.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.top.equalTo(self.iconimageView.snp.bottom).offset(5)
            make.height.equalTo(20)
        }
//        self.addSubview(lineView)
//        self.lineView.snp.makeConstraints { (make) in
//            make.bottom.equalToSuperview()
//            make.height.equalTo(1)
//            make.width.equalTo(ScreenWidth)
//            make.left.equalToSuperview()
//        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func dataInfo(dict:NSDictionary)  {
        iconimageView.image = UIImage.init(named: dict["icon"] as! String )
        titleLabel.text = (dict["name"] as! String)
    }
    
    
    
    
}
